package com.pinda.service;

import com.github.pagehelper.PageInfo;
import com.pinda.commonutils.Page;
import com.pinda.commonutils.Result;
import com.pinda.vo.HistoryVo;
import com.pinda.work.entity.PdDriverJob;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pinda.work.vo.Pddriverjob_TasktransportView;

import java.util.List;

/**
 * <p>
 * 司机作业单 服务类
 * </p>
 *
 * @author lc
 * @since 2023-06-14
 */
public interface IPdDriverJobService extends IService<PdDriverJob> {

    /**
     * 新增司机作业单
     *
     * @param driverJob 作业单信息
     * @return 作业单信息
     */
    PdDriverJob saveDriverJob(PdDriverJob driverJob);

    /**
     * 根据状态获取待提货列表和历史记录列表
     */
    Result<List<PdDriverJob>> getDriverJobByDriverIdAndTaskId(String driverId, Integer status);

    /**
     * 根据司机ID查询是否有在途任务
     */
    boolean extract(String driverId, Integer status);

    /**
     * 修改司机作业单状态为在途
     * 设置作业单交接人姓名
     */
    boolean upDriverJob(String driverId, PdDriverJob pdDriverJob);

    PdDriverJob selectOne(Integer status,String driverId);

    Result<HistoryVo> selectOnePdDriverJob(String taskTransportId);



    /**
     * 远程调用聚合数据库分页查询司机作业库
     *
     * @param page
     * @return
     */
    PageInfo<Pddriverjob_TasktransportView> PdddriverjobTasktransportService(Page<Pddriverjob_TasktransportView> page);

}
